<?php

	/**
	 * @see Zend_Application_Resource_ResourceAbstract
	 */
	require_once 'Zend/Application/Resource/ResourceAbstract.php';
	
	/**
	 * @see Bike_Options
	 */
	require_once 'Bike/Options.php';
	
	
	class Bike_Resource_Cachedefault extends Zend_Application_Resource_ResourceAbstract
	{
	    protected $_cache;
	    protected $_name;

	    public function init()
	    {
	        return $this->getCache();
	    }

	    public function getCache()
	    {
	        if (null === $this->_cache)
	        {
	            $cacheManager = $this->getBootstrap()->getPluginResource('cachemanager')->getCacheManager();
				Bike_Options::set($this, $this->getOptions());
	            $this->_cache = $cacheManager->getCache($this->getName());
	        }
	        return $this->_cache;
	    }

	    public function getName()
	    {
	    	return $this->_name;
	    }

	    public function setName($Name)
	    {
	    	$this->_name = $Name;
	    	return $this;
	    }
	}
